package com.skyolder.milkbee.domain;

import io.swagger.annotations.ApiModel;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import java.io.Serializable;
import java.time.ZonedDateTime;
import java.util.Objects;

/**
 * Comment 跟帖
 * content 内容
 * createdAt 创建时间
 * leaguerId 发帖人ID
 * userId 发帖人ID
 * CardId 主贴ID
 * accusation 举报次数
 */
@ApiModel(description = "Comment 跟帖 content 内容 createdAt 创建时间 leaguerId 发帖人ID userId 发帖人ID CardId 主贴ID accusation 举报次数")
@Entity
@Table(name = "comment")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class Comment implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    @Column(name = "seq")
    private Long seq;
    @Column(name = "content")
    private String content;
    @Column(name = "author")
    private String author;

    @Column(name = "created_at")
    private ZonedDateTime createdAt;

    @Column(name = "leaguer_id")
    private Long leaguerId;

    @Column(name = "user_id")
    private Long userId;

    @Column(name = "category_id")
    private Long categoryId;

    @Column(name = "card_id")
    private Long cardId;

    @Column(name = "accusation")
    private Long accusation;
    
    @Column(name = "light")
    private Long light;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    
    public Long getSeq() {
        return seq;
    }

    public Comment seq(Long seq) {
        this.seq = seq;
        return this;
    }

    public void setSeq(Long seq) {
        this.seq = seq;
    }
    
    public String getContent() {
        return content;
    }

    public Comment content(String content) {
        this.content = content;
        return this;
    }

    public void setContent(String content) {
        this.content = content;
    }
    public String getAuthor() {
    	return author;
    }
    
    public Comment author(String author) {
    	this.author = author;
    	return this;
    }
    
    public void setAuthor(String author) {
    	this.author = author;
    }

    public ZonedDateTime getCreatedAt() {
        return createdAt;
    }

    public Comment createdAt(ZonedDateTime createdAt) {
        this.createdAt = createdAt;
        return this;
    }

    public void setCreatedAt(ZonedDateTime createdAt) {
        this.createdAt = createdAt;
    }

    public Long getLeaguerId() {
        return leaguerId;
    }

    public Comment leaguerId(Long leaguerId) {
        this.leaguerId = leaguerId;
        return this;
    }

    public void setLeaguerId(Long leaguerId) {
        this.leaguerId = leaguerId;
    }

    public Long getUserId() {
        return userId;
    }

    public Comment userId(Long userId) {
        this.userId = userId;
        return this;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getCategoryId() {
        return categoryId;
    }

    public Comment categoryId(Long categoryId) {
        this.categoryId = categoryId;
        return this;
    }

    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }

    public Long getCardId() {
        return cardId;
    }

    public Comment cardId(Long cardId) {
        this.cardId = cardId;
        return this;
    }

    public void setCardId(Long cardId) {
        this.cardId = cardId;
    }

    public Long getAccusation() {
        return accusation;
    }

    public Comment accusation(Long accusation) {
        this.accusation = accusation;
        return this;
    }

    public void setAccusation(Long accusation) {
        this.accusation = accusation;
    }
    public Long getLight() {
        return light;
    }

    public Comment light(Long light) {
        this.light = light;
        return this;
    }

    public void setLight(Long light) {
        this.light = light;
    }
    
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Comment comment = (Comment) o;
        if (comment.id == null || id == null) {
            return false;
        }
        return Objects.equals(id, comment.id);
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(id);
    }

    @Override
    public String toString() {
        return "Comment{" +
            "id=" + id +
            ", content='" + content + "'" +
            ", createdAt='" + createdAt + "'" +
            ", leaguerId='" + leaguerId + "'" +
            ", userId='" + userId + "'" +
            ", categoryId='" + categoryId + "'" +
            ", cardId='" + cardId + "'" +
            ", accusation='" + accusation + "'" +
            '}';
    }
}
